public class ClassTest {
    public static void main(String[] args) {
        int arr[] = {1,2,3,4,5,6,7,8};

        for(int i:arr){
            System.out.print(i + " ");
        }
        System.out.println();

        for(int a=4;a<7;a++){
            arr[a]=arr[a+1];
        }
        arr[7]=0;
        for(int i:arr){
            System.out.print(i + " ");
        }
        System.out.println();

        
        for(int b=7;b>4;b--){
            arr[b]=arr[b-1];
        }
        arr[4]=5;

        for(int i:arr){
            System.out.print(i + " ");
        }
        System.out.println();
    }
}

